function r = end(lst, k, n)
%END Returns the max-index of specified dimension in MATLAB manner
%
% [ History ]
%   - Created by Dahua Lin, on Jan 5, 2008
%

if k == 1
    r = lst.n;
else
    r = 1;
end
